<?php

/*
 * Edit by shengxin
 * Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
 */

namespace app\admin\controller;

use cmf\controller\AdminBaseController;
use api\mall\model\StoreModel;

/**
 * Description of StoreController
 *
 * @author PC
 */
class MallController extends AdminBaseController
{

    public function setting()
    {
        $data = cmf_get_option('mall');
        $this->assign($data);
        return $this->fetch();
    }

    public function add()
    {
        $storeModel = new StoreModel();
        $items = $storeModel->types();
        $this->assign('item_types', $items);
        return $this->fetch();
    }

    public function edit()
    {
        $id = $this->request->get('id');
        $storeModel = new StoreModel();
        $data = $storeModel->where('id', $id)->find();
        if ($data) {
            $this->assign($data->toArray());

        }
        return $this->fetch();
    }
}
